home *** CD-ROM | disk | FTP | other *** search
- /* MicrosecondTimer.h */
- /*
- * Time measurement.
- * Copyright © 1991 Martin Minow. All Rights Reserved
- *
- /*
- * Definitions for the Millisecond timer
- */
- #ifndef _H_MsecTimer
- #define _H_MsecTimer
-
- #define MSEC_PER_TICK 1
-
- typedef struct MicrosecondEpoch {
- unsigned long time; /* Time of day */
- signed long microsecond; /* Residual */
- } MicrosecondEpoch, *MicrosecondEpochPtr;
-
- /*
- * Initialize the clock -- call once when your
- * application starts.
- */
- OSErr InitializeMicrosecondTimer(void);
- /*
- * Cancel the clock -- this is called automatically
- * when your application exits.
- */
- void CancelMicrosecondTimer(void);
- /*
- * Return the current extended time value.
- */
- void GetEpoch(MicrosecondEpochPtr result);
- /*
- * Compute the difference between two epoch's. The
- * result is in deltaTime (in microseconds).
- * deltaTime is positive if epoch2 is later than epoch1.
- *
- * Returns TRUE if the time can be represented in
- * microseconds (less than 35 minutes difference). If
- * it returns FALSE, deltaTime is likely to be garbage.
- */
- Boolean DeltaTime(
- MicrosecondEpochPtr epoch1,
- MicrosecondEpochPtr epoch2,
- signed long *deltaTime
- );
- /*
- * Format an epoch value as "hh:mm:ss.fraction"
- */
- void EpochToString(
- MicrosecondEpochPtr epochPtr,
- StringPtr result
- );
- /*
- * Use an extended time value to adjust the
- * local clock. Unfortunately, we can only adjust
- * the clock by an integral number of seconds.
- */
- void AdjustClock(
- signed long adjustment
- );
- #endif